function login(){
    debugger;
    var username = $("#loginName").val();
    var password = $("#Possword").val();
    if (username == "" || username == "请输入账号") {
        $("#info").text("请输入账号.");
        return;
    }
    if (password == "" || password == "请输入密码") {
        $("#info").text("请输入密码.");
        return;
    }
    var soap = new HWSOAP("./user/login.do");
    soap.send({
        username : username,
        password : password
    }, true, loginCallBack, loginFailCallBack);
}

var loginCallBack = function(oResult) {
    debugger;
    if(oResult.record == true){
        window.location.href = "/webapp/App.html?g_sPath='/webapp/home/Home.html'";
    }else{
        $("#info").text("用户名或密码错误!");
    }
}

var loginFailCallBack = function(oResult) {
}

$(function() {
    $(document).keydown(function(evt) {
        if (evt.keyCode == 13) {
            login();
        }
    });
});